﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Net;
using System.IO;
using System.Web.Script.Serialization;
using System.Runtime.Serialization;
using System.Runtime;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        // Json pentru product search
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://api.developer.sears.com/v1/productsearch?apikey=d4d3ccd64efb503e41fe92918b174c1f&store=Sears&keyword=Toshiba&searchType=keyword&contentType=json");
        // Json pentru Product Detail
        //        HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://api.developer.sears.com/v1/productdetails?apikey=d4d3ccd64efb503e41fe92918b174c1f&store=Sears&partNumber=05408391000P&contentType=json");
        request.KeepAlive = false;
        request.Method = "GET";
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
        StreamReader sr = new StreamReader(response.GetResponseStream());
        string respond = sr.ReadToEnd();


        /// PARSARE ???
        //     JavaScriptSerializer jss = new JavaScriptSerializer();
        //   var d = jss.Deserialize<dynamic>(respond);
        Label1.Text = respond;
    }
}